package com.kl.airticketserver.controller;

import cn.dev33.satoken.annotation.SaIgnore;
import com.kl.airticketserver.dto.Result;
import com.kl.airticketserver.entity.SysDictData;
import com.kl.airticketserver.service.SysDictService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;

@RestController
@RequestMapping("/api/system/dict")
public class SysDictController {
    
    private static final Logger log = LoggerFactory.getLogger(SysDictController.class);
    
    @Autowired
    private SysDictService dictService;
    
    @SaIgnore
    @GetMapping("/getDictData")
    public Result<List<SysDictData>> getDictData(@RequestParam String dictCode) {
        log.info("获取字典数据: dictCode={}", dictCode);
        List<SysDictData> data = dictService.getDictData(dictCode);
        return Result.success(data);
    }
}